import { base } from '@/config'
import http from '@/utils/request'

const companyApi = {
  // 新增快递公司
  addExpressCompany: params => {
    return http.postJson(`${base.open}/expressCompany/add`, params)
  },
  // 快递公司配置详情
  getExpressCompanyConfig: () => {
    return http.get(`${base.open}/expressCompany/config/detail`)
  },
  // 删除快递公司
  deleteExpressCompany: id => {
    return http.post(`${base.open}/expressCompany/delete/${id}`)
  },
  // 获取快递公司详情
  getExpressCompanyDetail: id => {
    return http.get(`${base.open}/expressCompany/detail/${id}`)
  },
  // 编辑快递公司
  updateExpressCompany: params => {
    return http.postJson(`${base.open}/expressCompany/edit`, params)
  },
  // 编辑快递公司状态
  updatedStatus: (type, id) => {
    return http.post(`${base.open}/expressCompany/${type}/${id}`)
  },
  // 获取快递公司列表
  getExpressCompany: params => {
    return http.get(`${base.open}/expressCompany/list`, params)
  },
  // 查询快递公司
  queryExpressCompany: params => {
    return http.get(`${base.open}/expressCompany/query`, params)
  }
}

export default companyApi
